package com.ozo.easy.gen.constant;

import com.ozo.easy.common.exception.AbstractExceptionEnum;
import lombok.Getter;

/**
 * 代码生成异常信息
 *
 * @author ozo
 * @date 2025-01-06
 */
@Getter
public enum GenExceptionEnum implements AbstractExceptionEnum {

    /**
     * 30000~39999之间
     */
    CODE_GENERATE_FAIL(30000, "代码生成失败"),
    IMPORT_FAIL(30001, "导入失败"),
    DB_TABLE_NOT_EXISTS(30002, "数据库表不存在"),
    CREATE_TABLE_FAIL(30003, "建表失败"),
    TABLE_DATA_NOT_EXISTS(30004, "表数据不存在"),
    COMMENT_MUST_BE_CHINESE(30005, "使用中文翻译字段时字段注释只能为中文"),
    COLUMN_TRANS_FAIL(30006, "字段翻译处理失败"),
    EXTEND_NOT_NEED_PRI(30007, "继承基类时无需填写主键字段"),
    EXTEND_NOT_NEED_BASE(30008, "继承基类时禁止填写基类字段"),
    COLUMN_NOT_REPEAT(30009, "字段名不能重复"),
    FIELD_TYPE_NOT_REPEAT(30010, "属性类型不能重复"),
    TABLE_CONFIG_EXISTS(30011, "表配置已存在"),

    ;

    private Integer code;

    private String message;

    GenExceptionEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

}
